﻿using System;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

using Skewworks.PicoMax;
using Skewworks.PicoMax.Controllers.SSD1351;
using Skewworks.PicoMax.Graphics565;

namespace PicoMaxPureMFDemo
{
    public class Program
    {

        static Graphics gfx;
        static PicoFont fnt = new PicoFont(Resources.GetBytes(Resources.BinaryResources.sansserif8));

        public static void Main()
        {
            // Uncomment the socket you want to use
            //CerberusSocket5();
            //CerberusSocket6();

            // Fill screen blue
            gfx.Screen.DrawRectangle(Colors565.Blue, 0, 0, 128, 128, Colors565.Blue);

            // Draw text centered in white
            gfx.Screen.DrawText("Hello World", fnt, Colors565.White, 0, 128 / 2 - fnt.FontHeight / 2, 128, fnt.FontHeight, true);

            // Flush to screen
            gfx.Flush(gfx.Screen);
        }

        static void CerberusSocket5()
        {
            gfx = new Graphics((Cpu.Pin)47, (Cpu.Pin)46, (Cpu.Pin)25, SPI.SPI_module.SPI1, 128, 128);
        }

        static void CerberusSocket6()
        {
            gfx = new Graphics((Cpu.Pin)13, (Cpu.Pin)14, (Cpu.Pin)26, SPI.SPI_module.SPI1, 128, 128);
        }


    }
}
